package dbmanager;

import java.sql.SQLException;
import java.sql.Timestamp;

import framework.NomUser;

public abstract class DatabaseObjectManager {
	private static NomUser login;
	protected static DatabaseManager dbm;

	public static void setLogin(NomUser n) {
		login = n;
	}

	public static NomUser getLogin() {
		return login;
	}

	public static void connect() throws SQLException {
		dbm = new DatabaseManager();
		dbm.connect();
	}

	public static void disconnect() throws SQLException {
		dbm.disconnect();
	}

	public static long stringToDate(String date) {
		return Timestamp.valueOf(date).getTime();
	}

	public static DatabaseManager getDatabaseManager() {
		return dbm;
	}
}
